// 对象的解构

const obj = {name: 'aaa', age: 18}

// const {name} = obj
// console.log(name)

// 解决变量名和 属性名重名冲突：重命名
const name = 'tom'
const {name: objName = 'jack'} = obj
console.log(objName)

// 解构赋值，简化代码编写
const {log} = console

log('foo')
log('bar')